UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sp0vsXiMFbe/9lfoep1MzkzU2SSPN5rgrkIQk72CL+Y=' 
WHERE 
  key_id = 'fff3dd36bd3d36407aa4226d2ae7ecc5db0827169433bfd1792c536cfe3ccba4' 
  AND (
    token = 'Sp0vsXiMFbe/9lfoep1MzkzU2SSPN5rgrkIQk72CL+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074