UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ph62G/RSaGpBht8Bf0RLVXehMWDjmrJ3/9ZViUDmhs=' 
WHERE 
  key_id = 'f8c5f24896d14b871566c4f557cb66a71f5944a5a802d9359f4f7124def29b85' 
  AND (
    token = '2ph62G/RSaGpBht8Bf0RLVXehMWDjmrJ3/9ZViUDmhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015