UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FB+/3qLNoSUSLx8QZw8FzU0kCz1TNfbF3FEgTaBqW/U=' 
WHERE 
  key_id = '89bb3003c47c4d77f090b73450ee4311884ebf86cbb5a544c23b652dfcaded52' 
  AND (
    token = 'FB+/3qLNoSUSLx8QZw8FzU0kCz1TNfbF3FEgTaBqW/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045