UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PBUJ2kWxM+JIJrGe2r2Xy9ygVm8zg1TBKaWv9uRbAnU='
WHERE
key_id = '5352b070d7125a34e82b2ad5eff72d8b9b768a3f509dbc03b6e15b85b73ce1b7'
AND (
token = 'PBUJ2kWxM+JIJrGe2r2Xy9ygVm8zg1TBKaWv9uRbAnU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)