UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bfxG84Vs1aPVeqHNckaoJitlUnBchBVXxdV/Rg4K4hw=' 
WHERE 
  key_id = 'b983b6f4b2c14047849a484ecae46e98211d6a1c26009360ea2f0f747d6c9d64' 
  AND (
    token = 'bfxG84Vs1aPVeqHNckaoJitlUnBchBVXxdV/Rg4K4hw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033