UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qH8VeLlQ+xrXqOOBzZGZ20H5tlIgGLHzxTVSTBPRvg4='
WHERE
key_id = '646552628e4342f3efa40a06ebf1dee8b8920096e8fcc5735e20a32e0ee08f86'
AND (
token = 'qH8VeLlQ+xrXqOOBzZGZ20H5tlIgGLHzxTVSTBPRvg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)