UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'La1rg7Hlrzhdx605eBg+pNAjgydUXEQwrjsiNdVKIs4='
WHERE
key_id = 'a3cc3dee3451ef11e22deeb817f5addea89dc487bf955b052c26d9cd45c2e139'
AND (
token = 'La1rg7Hlrzhdx605eBg+pNAjgydUXEQwrjsiNdVKIs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)