UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yspZKOX9kKWb1Q6UF47Vm1UdX/VlKisSvWM8aNkdLrg=' 
WHERE 
  key_id = '62053a7d678d5943e61ffaa002ffcdc7c50fb3d3cd9c6ad319c903072d7319af' 
  AND (
    token = 'yspZKOX9kKWb1Q6UF47Vm1UdX/VlKisSvWM8aNkdLrg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024