UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yyXPjHD4gRSoVmHNEu9RfbtMcZ4Y3t/oUkpq7TJaj8w=' 
WHERE 
  key_id = 'd70f8a89c64cfcde808af6a82b146e3d80dcca0c7ea17f725d884affa99a315a' 
  AND (
    token = 'yyXPjHD4gRSoVmHNEu9RfbtMcZ4Y3t/oUkpq7TJaj8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016