UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Otlb9XBRdrny8VhzVeuw0wR3Jf0iSgtpwH0KaQSj39g=' 
WHERE 
  key_id = '597023d1e7e74ae9bb79061b9543497bb4861ae7c7b390574be84acc7dfe11b8' 
  AND (
    token = 'Otlb9XBRdrny8VhzVeuw0wR3Jf0iSgtpwH0KaQSj39g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070