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