UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k94LxHkwTsCjHgHVsPg6nGxWCVQysqN2EaLQb8HKY4k=' 
WHERE 
  key_id = 'bea43ad86d17ca86ed50810c2fd0874bf5a0f7159f4018f9dd45db009a5242be' 
  AND (
    token = 'k94LxHkwTsCjHgHVsPg6nGxWCVQysqN2EaLQb8HKY4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038