UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VZHZCH65jrSFnDDbhzaLHaYnSpadJHiJCJpeXt/dXI0='
WHERE
key_id = '4bac766144a5198e01f42f4cbaa1e297f23206bbd9b6e6798c129d8ed9564747'
AND (
token = 'VZHZCH65jrSFnDDbhzaLHaYnSpadJHiJCJpeXt/dXI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)