UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3HDC/lUQZ56Vpq3TYAav9lB4AZT7WT3d/87Pr508d8k=' 
WHERE 
  key_id = 'db2f1d07456ceb0c0afe2e33a94ffb8277ea3a99717f8fc5eef5a61e5bbcc567' 
  AND (
    token = '3HDC/lUQZ56Vpq3TYAav9lB4AZT7WT3d/87Pr508d8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041