UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vCumKUzDw+yZtxogCOz3ubttMe6OLsT2qAE2VSzsePI='
WHERE
key_id = 'a5d97cc4636f71d64e6dcce74a56d04ca02c391e1598d028d33620d41615dc73'
AND (
token = 'vCumKUzDw+yZtxogCOz3ubttMe6OLsT2qAE2VSzsePI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)