UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WMVaSxmgmwBwY6wmQ1sZwk+rYOY9LfbQ1FHaGrQywe0='
WHERE
key_id = 'c950e336678452442813c128adfa6ba7b61b9689a11e4ea06c1b7c03c3fc4430'
AND (
token = 'WMVaSxmgmwBwY6wmQ1sZwk+rYOY9LfbQ1FHaGrQywe0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)