UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J0vsWMsvgEnsBuOVeoLpvoR58eTiWL7wcMSaUQE6y5k='
WHERE
key_id = 'b654fe65c6c3515970d087af48c2f8ede410a69f7a092967c1d1687423140766'
AND (
token = 'J0vsWMsvgEnsBuOVeoLpvoR58eTiWL7wcMSaUQE6y5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)