UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hxvRDaxoRbch0heA4Y1sjJuAKv3RfFVpHRG4sAhz6No=' 
WHERE 
  key_id = '84b7cf467586b20ff8c8fb3149e29b4bbe701e6e32c51b5c5191178d61c91ae7' 
  AND (
    token = 'hxvRDaxoRbch0heA4Y1sjJuAKv3RfFVpHRG4sAhz6No=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027