UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zPlOu2/7v8A8+ujnxDKvRPWD1uIv0lMwCihXNybKRE4='
WHERE
key_id = 'ee1f213ca74191fa20cbe0f147d088be561329ea760dc797486f02cd9290c720'
AND (
token = 'zPlOu2/7v8A8+ujnxDKvRPWD1uIv0lMwCihXNybKRE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)