UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0GE1I9jy1xYHuCErL5+vP4JEhYQ1Q/InmXvtkN3j58U=' 
WHERE 
  key_id = 'f232688ba69269d02fecd3bb462984aea4464f809be68f76e1b6ac8e21fdc108' 
  AND (
    token = '0GE1I9jy1xYHuCErL5+vP4JEhYQ1Q/InmXvtkN3j58U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041