UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oVW4jw/V8w374nou1zv7zF+guVcJeEGZ4Gmvsldvqw4=' 
WHERE 
  key_id = '878b705ddaf5253599710e0a3683f66bd2a27dd404264994b65b92f5d74e0cf2' 
  AND (
    token = 'oVW4jw/V8w374nou1zv7zF+guVcJeEGZ4Gmvsldvqw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021