UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LiSRFyPnaLY8YjSfEV7XWHonrnnsjhATIa0evr/VlAU='
WHERE
key_id = 'ef4246081738e07463f93bf67e2f975ed296a0005e344bdd9f3677b227f8dffb'
AND (
token = 'LiSRFyPnaLY8YjSfEV7XWHonrnnsjhATIa0evr/VlAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)