UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QeykQF1LuT4oKXJLBwBDXunFlmODN2sP1DpKjkDYKIU='
WHERE
key_id = '49500ef1c39d0f6e83113df91735b221b8a0e64f8b5c083cad7057174e543259'
AND (
token = 'QeykQF1LuT4oKXJLBwBDXunFlmODN2sP1DpKjkDYKIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)