UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J60CHFGSLSdBX/FfnQ7aGJ7lJpbKVowxe6G2WS9NRts=' 
WHERE 
  key_id = '31e0418096dabd787b62e1fab45bde3f26ee2a4fd8ff521b98d490c93240b308' 
  AND (
    token = 'J60CHFGSLSdBX/FfnQ7aGJ7lJpbKVowxe6G2WS9NRts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00097