UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D1+pSG1eqSaBh8+vOdlqmuVLgElUcDljtB2A57wvDZs=' 
WHERE 
  key_id = '015c703261783f1603be70c32aa4a6ad27d42f9d9aef8dac50047af905538041' 
  AND (
    token = 'D1+pSG1eqSaBh8+vOdlqmuVLgElUcDljtB2A57wvDZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049