UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rPEWUswYP/yNmT3I3j7R5kUgGqlso6JlHU06WkunO6A=' 
WHERE 
  key_id = '3692b605630c1919b353357519dfc77045ed366eb4ccb21846f468a744698b4c' 
  AND (
    token = 'rPEWUswYP/yNmT3I3j7R5kUgGqlso6JlHU06WkunO6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035