UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Reno5zCkY1nK1DlNc8fy9dHibVJ3JssWnvRdHE7CzJw=' 
WHERE 
  key_id = '4cf39a1b40387e90e2d222a3bf435704b6c80716ee08ae5a03e90e4719b28e54' 
  AND (
    token = 'Reno5zCkY1nK1DlNc8fy9dHibVJ3JssWnvRdHE7CzJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013