UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MNapkDmU+K8phcjYXIq8vh2SmZHZvK8RxTXOHHYO820='
WHERE
key_id = '1a63f05c15131662202bd4c657a977c16e2761835a7d24171617862ac8da8b9f'
AND (
token = 'MNapkDmU+K8phcjYXIq8vh2SmZHZvK8RxTXOHHYO820='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)