UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QeJzbF95uWsTjhB1bV9/Elbad8y/6MNMwuq+y2SEYKM='
WHERE
key_id = '0ba17efebad26564895414e996fd7f4c618fd38d2d53ba486e3d552c0e1c7f14'
AND (
token = 'QeJzbF95uWsTjhB1bV9/Elbad8y/6MNMwuq+y2SEYKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)