UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZjmyGBIxurCvCBdURfTUFIxP2+ie8lzaZHtBXp88B30='
WHERE
key_id = 'e19d76bc2f27912b1c05d56fb65c98e8f989f831e3be04048c7b9f9d9b986e3c'
AND (
token = 'ZjmyGBIxurCvCBdURfTUFIxP2+ie8lzaZHtBXp88B30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)