UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3oibkvR9BYgE9UNnbRN0tZiBDBish1b6Uhu1bWGB4JU=' 
WHERE 
  key_id = 'f74088175b80cf5b4303ca307cf417f276284f73887a0311c2a5e469c6083bf6' 
  AND (
    token = '3oibkvR9BYgE9UNnbRN0tZiBDBish1b6Uhu1bWGB4JU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034