UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'esMxaLkUdg6kRz6hP2vdxHxrHHdEwZMxl//4JLmyPOI=' 
WHERE 
  key_id = '7684837e111946f56797da58ff0c85ce77abbec2235fc2fd92238c3fcb4d942c' 
  AND (
    token = 'esMxaLkUdg6kRz6hP2vdxHxrHHdEwZMxl//4JLmyPOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050