UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GPlTSC4GuInvyoODtA39UYR1dPCaHLdw+SKRyFWY0NQ='
WHERE
key_id = '69de8a9bdf0cad5214125268ce6eae4c5affd2931f008583af13829e613a08ca'
AND (
token = 'GPlTSC4GuInvyoODtA39UYR1dPCaHLdw+SKRyFWY0NQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)