UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZeWKk+m4gS4qM9lu3tlKieENek7vy7GpAlQlouXFj+0=' 
WHERE 
  key_id = '81fbba0e8aa5e7406b87055d37f43bc6c421766dcdb9d0976f7dd4e195299e2d' 
  AND (
    token = 'ZeWKk+m4gS4qM9lu3tlKieENek7vy7GpAlQlouXFj+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035