UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vG7xEX9e41zC+YYuiWGIVWk5lOIoE3scoBoaecbNGMc='
WHERE
key_id = 'f49f9e73ed8513d33c6cd95b6138abc7b5a6606006c1959f1e76691d4f3b2f0f'
AND (
token = 'vG7xEX9e41zC+YYuiWGIVWk5lOIoE3scoBoaecbNGMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)