UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zACzNcl0RI6CXgXJqxcadW1RIABVcMLdec+9PqzGfRg='
WHERE
key_id = '6e7b16b59565045b3843870ff8581cd1155d3ca0eb68a746284586cd30a62431'
AND (
token = 'zACzNcl0RI6CXgXJqxcadW1RIABVcMLdec+9PqzGfRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)