UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4OAslDHuboiC7B7UcJXW7a3X89cXVfU25PeV9wovMvE=' 
WHERE 
  key_id = '13f3ff47036a79fe86ebd31ca9b32bf93bc512db22905cb29e5fa937ef1ae268' 
  AND (
    token = '4OAslDHuboiC7B7UcJXW7a3X89cXVfU25PeV9wovMvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039