UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RbU5qoe1WhQljdF+xDFB+pdAhtnv2LdqinwNwi5GzgM='
WHERE
key_id = '6b729ed433cb5c799b447956f280270a3f77c6d28e617f5d3b2f9eab5ffe742d'
AND (
token = 'RbU5qoe1WhQljdF+xDFB+pdAhtnv2LdqinwNwi5GzgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)