UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qJXmL4sM/yZ8yXcgRvJKWc7XEFjxjz/LwIW40Xg5b2c='
WHERE
key_id = '0719764cd563384b3ab191a63ca399c6a958191f61b9547f4bdb6efb5d32c1e7'
AND (
token = 'qJXmL4sM/yZ8yXcgRvJKWc7XEFjxjz/LwIW40Xg5b2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)