UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G30yDymO7m857yyYeFd+4eDHnGSze0qCa2A41AbvzD0=' 
WHERE 
  key_id = '5a01cced76c55f9463bb1830dcb54e6af0f8a55111b15a237a19df513144bbf9' 
  AND (
    token = 'G30yDymO7m857yyYeFd+4eDHnGSze0qCa2A41AbvzD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044