UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YvuqhWcmXzeRFINbc87yMoevBwgZ/jdyoyNvXQJvEq8=' 
WHERE 
  key_id = '2e56b3814fe972d9b35f1195e7f95e66f546e1c3d0425072317d463cbeb6705b' 
  AND (
    token = 'YvuqhWcmXzeRFINbc87yMoevBwgZ/jdyoyNvXQJvEq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027