UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmW5htfyAIGQr6pPldzS9cuox6Zz92T28hLcIZaWdyI=' 
WHERE 
  key_id = '7c5a5d062bf869c72860afe64cfe2596ac81ceed2da8fd16fd164e6f1ed8c76e' 
  AND (
    token = 'ZmW5htfyAIGQr6pPldzS9cuox6Zz92T28hLcIZaWdyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030