UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '79sn65mwKHhPfLK7GzGO63rfzkJ9uzdZyhjFMxGqPZk='
WHERE
key_id = 'af1409ebc6b475858758fc73c3aae767ae9dd100b71ec53e8a483e44c919fd96'
AND (
token = '79sn65mwKHhPfLK7GzGO63rfzkJ9uzdZyhjFMxGqPZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)