UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'auaX95qBLTwdoZI89dcwIO8IpWk5u8sTmc3NwkQtD2k=' 
WHERE 
  key_id = '6a806748fc45c27680971af2241efcd4b24b95fd713d4d97754d1e34c6c6eeab' 
  AND (
    token = 'auaX95qBLTwdoZI89dcwIO8IpWk5u8sTmc3NwkQtD2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049