UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i/8ZvciE5vLkIhhM4Gv15+u2NJVFBia7QGIlQWPYAho=' 
WHERE 
  key_id = '875214d454d3338e1934019d682657a899ee81e1ff0737d8bac3855b4ca736bd' 
  AND (
    token = 'i/8ZvciE5vLkIhhM4Gv15+u2NJVFBia7QGIlQWPYAho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029