UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WHphx8sHaXLXpGvph456VeyX+gQuVsxXsA/WvIvnVM4='
WHERE
key_id = '35590f543b9efaa8cb6c907a5012f4cef1c6514a3cd55ecfb4eb8ce172bcd71d'
AND (
token = 'WHphx8sHaXLXpGvph456VeyX+gQuVsxXsA/WvIvnVM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)