UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2RwccERDQK/MyhYehIfexIdHHZrvbUiP7VD13hTKDj8=' 
WHERE 
  key_id = 'df52cb74d78f26909d0a092d57500eb9317cb0f807f0166be062294e85e673b7' 
  AND (
    token = '2RwccERDQK/MyhYehIfexIdHHZrvbUiP7VD13hTKDj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022