UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QVGU9XHcDJakZ4lXRXdVYJe2JqeQPtnb1oVmNQFc86Y='
WHERE
key_id = '6e4151494f46792e46ab38ee39becf6b067f048a78b4d6522e1368880dba92e3'
AND (
token = 'QVGU9XHcDJakZ4lXRXdVYJe2JqeQPtnb1oVmNQFc86Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)