UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WlyQ0W1pIpY/5sEYvkCHgO/o2msV8IP824TThY9gZog=' 
WHERE 
  key_id = '2b009381111c8ea16cdf8ffac6e8e000cb1b99d6a2f21325e7f0500a83b478d6' 
  AND (
    token = 'WlyQ0W1pIpY/5sEYvkCHgO/o2msV8IP824TThY9gZog=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037