UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j4iYRjaUj+hMbkop3GMZ6g6erQlh17IXOphBg31VSAA='
WHERE
key_id = '630e753981bf175d05f1f9dcb04dafdc5fc2d7c65fe6cc72320056a3abdddd96'
AND (
token = 'j4iYRjaUj+hMbkop3GMZ6g6erQlh17IXOphBg31VSAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)