UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NUfCPQ/7FwqfgrpscnNsSZCw7aiIXx2QP9AFK5UqPGc='
WHERE
key_id = '52dd3a9a89940b36d603e6b71c75bfb81593969f342f0a6cf1eb256c6f5ea145'
AND (
token = 'NUfCPQ/7FwqfgrpscnNsSZCw7aiIXx2QP9AFK5UqPGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)