UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HsVs1D5r+OUdyHNBSvUDvetT+0iuTZuB9yH1esjIzqs=' 
WHERE 
  key_id = '2225ed2d219401be252d543949564f95c4c2c85bbe436839cb73e2baae03e045' 
  AND (
    token = 'HsVs1D5r+OUdyHNBSvUDvetT+0iuTZuB9yH1esjIzqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030