UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VaFRYX1jvjtSr17cF2Of75O2vOc+pcAVD/uiT/0JIRo=' 
WHERE 
  key_id = 'ec173d5605cedb2e2a4540c39fca79f319a06a80c7d73a74874a69c9308cbb34' 
  AND (
    token = 'VaFRYX1jvjtSr17cF2Of75O2vOc+pcAVD/uiT/0JIRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022