UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0aLMx+TYENAzFFqkYFxMpPr7OdP4a2AR1yGtFJ8LliM='
WHERE
key_id = 'ce718bd96f77e537292d21feade10a01502a2218f9ac0f56807271819915a2c3'
AND (
token = '0aLMx+TYENAzFFqkYFxMpPr7OdP4a2AR1yGtFJ8LliM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)