UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0WKJkNglPqgpIj703vA7QgHlnx+xpQ76lJO90g6LJOk='
WHERE
key_id = 'c1362a8a25f5a46a9d4672dc4773513f13c597ab71d72bf7e2ebc49835902a9e'
AND (
token = '0WKJkNglPqgpIj703vA7QgHlnx+xpQ76lJO90g6LJOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)