UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BeJhF3z6Kq3GebRlkmvAip2BMwGpaVwLUCFnfAP0w+g='
WHERE
key_id = 'b43910a6f2b5ce12b78dbd21f4fc0dcdcb395c36b2efd243d4081b41ba3c44e9'
AND (
token = 'BeJhF3z6Kq3GebRlkmvAip2BMwGpaVwLUCFnfAP0w+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)