UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sKJFEo6BulRjJAszvHss47mk8b6QzVKYC+cwpMjUH7g=' 
WHERE 
  key_id = '174badbd5e9f0eece642e3600a0254b2779799e95ce748ea80ecfae1b79601cd' 
  AND (
    token = 'sKJFEo6BulRjJAszvHss47mk8b6QzVKYC+cwpMjUH7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030