UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't9L1BJCZAwBZRGYoHSmvVn46ENtxt1rKgKP0snVldoY='
WHERE
key_id = '72f2225cea5a32b884d54963d0828841cd1bc07c54b1eae2d9afc5066847b0b6'
AND (
token = 't9L1BJCZAwBZRGYoHSmvVn46ENtxt1rKgKP0snVldoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)