UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3m6uQL2mW518EjfHx1M5bPB3Cf9XkoDim5d2IuWFSiU='
WHERE
key_id = 'c244911ef742ffbdb734c3c0b569bbf37828cab1a4fc1e402e530fb0367f2d10'
AND (
token = '3m6uQL2mW518EjfHx1M5bPB3Cf9XkoDim5d2IuWFSiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)