UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tkUNMK+Wl2OLDIkSK2q5PhGO3Fz2nxfYqnEbq8ahSf4='
WHERE
key_id = '193193ebdf752aeac08953af2031a887c483aa14042636510fa43d2c5a915bd1'
AND (
token = 'tkUNMK+Wl2OLDIkSK2q5PhGO3Fz2nxfYqnEbq8ahSf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)