UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '06Y+f0C9RxnuzrmGF+suR47EHMR8Y/sBhS47gxtwNhw='
WHERE
key_id = '5f1baba56d3f4ea8cb27587f58a601a1964f6ac69096a900c4101c4343501f32'
AND (
token = '06Y+f0C9RxnuzrmGF+suR47EHMR8Y/sBhS47gxtwNhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)